package com.nchu.web.interceptor;

import javax.servlet.http.HttpSession;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;

public class teacherUIInterceptor implements Interceptor{

	@Override
	public void intercept(Invocation inv) {
		Controller controller = inv.getController();
	    HttpSession session=controller.getSession();
	    String s=(String)session.getAttribute("teacher_user");
		System.out.println("accessInterceptor:"+s);
		if((s!="")&&(s!=null)){
			inv.invoke();
		}else{
			controller.forwardAction("/visit"); 
		}
	}

}
